package com.sitech.ibnms.c3p.service;

import com.sitech.ibnms.c3p.task.notice.ExecutePolicy;

import java.util.Map;

/**
 * 供前台调用的任务相关服务
 * Created by liujhc on 7/5.
 */
public interface C3pTaskFlowService {

    /**
     * 启动任务流程
     *
     * @param c3pTaskId C3P 任务ID
     * @param userId
     * @return execId
     */
    int startTask(String c3pTaskId, String userId, String title);

    /**
     *
     * @param c3pTaskId
     * @param userId
     * @param title
     * @param executePolicies 格式为ActivityId->ExecutePolicy, 定义后续环节的执行策略
     * @return execId
     */
    int startTaskWithExecutePolicies(String c3pTaskId, String userId, String title, Map<Integer, ExecutePolicy> executePolicies);

    /**
     * 终止任务实例
     *
     * @param serialNo
     * @param userId
     * @param title
     */
    void terminate(int serialNo, String userId, String title);


    /**
     * 带环节执行策略参数的启动环节方法
     *
     * @param taskId
     * @param userId
     * @param title
     * @param executePolicies 格式为ActivityId->ExecutePolicy, 定义后续环节的执行策略
     */
    void startNodeWithExecutePolicies(int taskId, String userId, String title, Map<Integer, ExecutePolicy> executePolicies);
    public Map<String, String> executeShell(Map<String, String> params,Map<String,String> inputVars, Map<String,String> outputVars);
    public Map<String, String> executeSql(Map<String, String> params,Map<String,String> inputVars);
}
